package com.ruoyi.retirement.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.retirement.domain.RetirementAgreement;
import com.ruoyi.retirement.mapper.RetirementAgreementMapper;
import com.ruoyi.retirement.service.IRetirementAgreementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 界面与协议Service业务层处理
 * 
 * @author 曹旭
 * @date 2025-09-08
 */
@Service
public class RetirementAgreementServiceImpl implements IRetirementAgreementService 
{
    @Autowired
    private RetirementAgreementMapper retirementAgreementMapper;

    /**
     * 查询界面与协议
     * 
     * @param id 界面与协议主键
     * @return 界面与协议
     */
    @Override
    public RetirementAgreement selectRetirementAgreementById(Long id)
    {
        return retirementAgreementMapper.selectRetirementAgreementById(id);
    }

    /**
     * 查询界面与协议列表
     * 
     * @param retirementAgreement 界面与协议
     * @return 界面与协议
     */
    @Override
    public List<RetirementAgreement> selectRetirementAgreementList(RetirementAgreement retirementAgreement)
    {
        return retirementAgreementMapper.selectRetirementAgreementList(retirementAgreement);
    }

    /**
     * 新增界面与协议
     * 
     * @param retirementAgreement 界面与协议
     * @return 结果
     */
    @Override
    public int insertRetirementAgreement(RetirementAgreement retirementAgreement)
    {
        retirementAgreement.setCreateTime(DateUtils.getNowDate());
        return retirementAgreementMapper.insertRetirementAgreement(retirementAgreement);
    }

    /**
     * 修改界面与协议
     * 
     * @param retirementAgreement 界面与协议
     * @return 结果
     */
    @Override
    public int updateRetirementAgreement(RetirementAgreement retirementAgreement)
    {
        retirementAgreement.setUpdateTime(DateUtils.getNowDate());
        return retirementAgreementMapper.updateRetirementAgreement(retirementAgreement);
    }

    /**
     * 批量删除界面与协议
     * 
     * @param ids 需要删除的界面与协议主键
     * @return 结果
     */
    @Override
    public int deleteRetirementAgreementByIds(Long[] ids)
    {
        return retirementAgreementMapper.deleteRetirementAgreementByIds(ids);
    }

    /**
     * 删除界面与协议信息
     * 
     * @param id 界面与协议主键
     * @return 结果
     */
    @Override
    public int deleteRetirementAgreementById(Long id)
    {
        return retirementAgreementMapper.deleteRetirementAgreementById(id);
    }
}
